package com.thug.ai;

import java.util.ArrayList;

import com.thug.engine.BaseGameEntity;
import com.thug.engine.SceneManager;

public abstract class AIManager<T> {

	private SceneManager mSceneMgr;
	protected ArrayList<T> mEntities;
	protected StageMap mStageMap;
	protected BaseGameEntity mPlayerEntity;
	
	public AIManager() {
		mEntities = new ArrayList<T>();
	}
	
	public void registerSceneManager(SceneManager s) {
		mSceneMgr = s;
	}
	
	public SceneManager getSceneMgr() { return mSceneMgr; }
	
	public void registerEntities(ArrayList<T> entities) {
		mEntities.addAll(entities);
	}
	public void registerEntity(T entity) {
		mEntities.add(entity);
	}
	
	public void unRegisterEntities(ArrayList<T> entities) {
		mEntities.removeAll(entities);
	}
	
	public void unRegisterEntity(T entity) {
		mEntities.remove(entity);
	}
	
	public void registerStageMap(StageMap map) {
		mStageMap = map;
	}
	
	public void registerPlayer(BaseGameEntity player) {
		mPlayerEntity = player;
	}
	
	//public abstract void update(ArrayList<T> entities, final float elapsedTime);
	
	//public abstract void update(T entity, final float elapsedTime);
	
	public abstract void update(final float elapsedTime);
}
